<template>
  <!-- 推荐模块 -->
  <div class="mod-rec">
    <banner></banner>
    <hot></hot>
    <new-disc></new-disc>
    <top-list></top-list>
    <mv></mv>
  </div>
</template>

<script>
// 导入轮播图组件
import Banner from "views/recommend/child/Banner.vue";
// 导入热门推荐组件
import Hot from "views/recommend/child/Hot.vue";
// 导入新碟上架组件
import NewDisc from "views/recommend/child/NewDisc.vue";
// 导入排行榜组件
import TopList from "views/recommend/child/TopList.vue";
// 导入mv组件
import Mv from "views/recommend/child/Mv.vue";
export default {
  components: {
    Banner,
    Hot,
    TopList,
    NewDisc,
    Mv,
  },
  data() {
    return {
      personalized: [],
    };
  },
  created() {
    // this.getPersonalized();
  },
  methods: {
    getPersonalized() {
      this.axios({
        /* 热门推荐接口地址 */
        url: "/personalized?limit=30",
      })
        .then((res) => {
          this.personalized[0] = res.data.result.slice(0, 10);
          this.personalized[1] = res.data.result.slice(10, 20);
          this.personalized[2] = res.data.result.slice(20, 30);

          console.log("getPersonalized");
          // console.log(this.personalized[0]);
          // console.log(this.personalized[1]);
          // console.log(this.personalized[2]);
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
};
</script>

<style>
</style>